package social_network.entities;
/**
 * 
 * @author Katerina Gluschenko
 */
public class User {
    private Integer id;
    private String nickName;
    private String email;
    private String password;

    public User(Integer id, String nickName, String email, String password) {
        this.id = id;
        this.nickName = nickName;
        this.email = email;
        this.password = password;
    }

    public Integer getId() {
        return id;
    }

    public String getNickName() {
        return nickName;
    }

    public String getEmail() {
        return email;
    }

    public String getPassword() {
        return password;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof User)) {
            return false;
        }
        if (this == object) return true;
        
        User other = (User) object;
        
        if ((this.id == null && other.id != null) || 
                (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        
        return  this.id.equals(other.id) 
                && this.email.equals(other.email)
                && this.nickName.equals(other.nickName)
                && this.password .equals(other.password);
    }
        
    @Override
    public String toString() {
        return "entities.User[ id=" + id + " ]";
    }
    
}
